API Docs for: 1.0.0
Show:

TYRO.BaseIClient Class

Module: TYRO

A mixin used by both versions of the iClient. We'd hide this but yuidoc doesn't make that easy. See in the TYRO module description.

Methods

addTip

(
  • completionReference
  • tipAmount
  • responseReceivedCallback
)

Add a tip to a previous purchase (initiatePurchase).

Parameters:

  • completionReference String

    Transaction identifier from the original transaction.

  • tipAmount String

    The tip amount to add in cents.

  • responseReceivedCallback Function

    Invoked to indicate success or failure. Called with a single Object containing the following properties:

    • resultString
      One of the following values: success, failure.
    • messageString
      Message to show the merchant.

Example:

// to add a $3.00 tip to a transaction with completion reference 543123
iclient.addTip("543123", "300", yourPosCode.handleResponse);

closeTab

(
  • completionReference
  • amount
  • responseReceivedCallback
)

Close a previously opened bar tab (initiateOpenTab) with a final amount. The customer will be charged.

Parameters:

  • completionReference String

    Transaction identifier from the original transaction.

  • amount String

    The final amount to charge the customer.

  • responseReceivedCallback Function

    Invoked to indicate success or failure. Called with a single Object containing the following properties:

    • resultString
      One of the following values: success, failure.
    • messageString
      Message to show the merchant.

Example:

// to close the tab with completion reference 543123 and bill a customer $120.01
iclient.closeTab("543123", "12001", yourPosCode.handleResponse);

completePreAuth

(
  • requestParams
  • responseReceivedCallback
)

Close a previously opened preAuth (initiateOpenPreAuth) with a final amount. The customer will be charged.

Parameters:

  • requestParams Object

    An object containing the following properties:

    • completionReference String

      Transaction identifier from the original transaction.

    • amount String

      The final amount to charge the customer.

    • [integrationKey] String optional

      Supply the integration key if your browser does not support local storage.

    • [mid] Int optional

      Override the configured mid for multi-merchant terminals.

    • [tid] Int optional

      Override the configured tid for multi-merchant terminals.

  • responseReceivedCallback Function

    Invoked to indicate success or failure. Called with a single Object containing the following properties:

    • resultString
      One of the following values: success, failure.
    • messageString
      Message to show the merchant.

Example:

// to close the preAuth with completion reference 543123 and bill a customer $120.01
iclient.completePreAuth({amount: "12001", completionReference: "543123"}, yourPosCode.handleResponse);

healthpointReconciliationReport

(
  • requestParams
  • responseReceivedCallback
)

Retrieve a payments or claims HealthPoint reconciliation report.

Parameters:

  • requestParams Object

    An object containing the following properties:

    • reconDate String

      The reporting date in format yyyyMMdd.

    • reportType String

      The report type. Valid values are payments and claims.

    • integrationKey String

      Supply the integration key if your browser does not support local storage.

  • responseReceivedCallback Function

    Callback to return the report or error message. Called with a single Object containing the following properties:

    • resultString
      One of the following values: success, failure.
    • dataString
      The report in xml format.
    • errorString
      An error message to show the merchant. Only present when result is failure.

Example:

     // to retrieve the HealthPoint payments report for 25th December 2012
     iclient.healthpointReconciliationReport({
        reportType: "payments",
        reconDate "20121225"
     }, yourPosCode.handleResponse);

manualSettlement

(
  • responseReceivedCallback
  • options
)

Manually settle the terminal: close off reporting for the day.

Parameters:

  • responseReceivedCallback Function

    Called with a single Object containing the following properties:

    • resultString
      One of the following values: success, failure.
    • messageString
      Message to show the merchant.
    • currentTerminalBusinessDayString
      Current reporting day after settlement request. Only returned if result is success. Format dd/MM/yyyy.

  • options Object

    An object containing the following properties:

    • [mid] Int optional

      Override the configured mid for multi-merchant terminals or if your browser does not support local storage.

    • [tid] Int optional

      Override the configured tid for multi-merchant terminals or if your browser does not support local storage.

    • [integrationKey] String optional

      Supply the integration key if your browser does not support local storage.

Example:

// to close the current reporting day
iclient.manualSettlement(yourPosCode.handleResponse);

reconciliationReport

(
  • requestParams
  • responseReceivedCallback
)

Retrieve a summary or detail reconciliation report.

Parameters:

  • requestParams Object

    An object containing the following properties:

    • terminalBusinessDay String

      The reporting date in format yyyyMMdd.

    • type String

      The report type. Valid values are summary and detail.

    • format String

      The report format. Valid values are txt and xml. The txt version is pre-formatted in a monospaced font.

    • [integrationKey] String optional

      Supply the integration key if your browser does not support local storage.

    • [mid] Int optional

      Override the configured mid for multi-merchant terminals.

    • [tid] Int optional

      Override the configured tid for multi-merchant terminals.

  • responseReceivedCallback Function

    Callback to return the report or error message. Called with a single Object containing the following properties:

    • resultString
      One of the following values: success, failure.
    • formatString
      The request parameter format is passed back for convenience.
    • typeString
      The request parameter type is passed back for convenience.
    • dataString
      The report. Pre-formatted text when format is txt. Parsable xml when format xml.
    • errorString
      An error message to show the merchant. Only present when result is failure.

Example:

// to retrieve the pre-formatted detail report for 25th December 2012
iclient.reconciliationReport({
   type: "detail",
   terminalBusinessDay "20121225"
   format: "txt"
}, yourPosCode.handleResponse);

voidPreAuth

(
  • requestParams
  • responseReceivedCallback
)

Void a previously opened preAuth (initiateOpenPreAuth). This discards the hold on funds in the customer's account.

Parameters:

  • requestParams Object

    An object containing the following properties:

    • completionReference String

      Transaction identifier from the original transaction.

    • [integrationKey] String optional

      Supply the integration key if your browser does not support local storage.

    • [mid] Int optional

      Override the configured mid for multi-merchant terminals.

    • [tid] Int optional

      Override the configured tid for multi-merchant terminals.

  • responseReceivedCallback Function

    Invoked to indicate success or failure. Called with a single Object containing the following properties:

    • resultString
      One of the following values: success, failure.
    • messageString
      Message to show the merchant.

Example:

// to void a preAuth with completion reference 543123
iclient.voidPreAuth({completionReference: "543123"}, yourPosCode.handleResponse);

voidTab

(
  • completionReference
  • responseReceivedCallback
)

Void a previously opened bar tab (initiateOpenTab). This discards the hold on funds in the customer's account.

Parameters:

  • completionReference String

    Transaction identifier from the original transaction.

  • responseReceivedCallback Function

    Invoked to indicate success or failure. Called with a single Object containing the following properties:

    • resultString
      One of the following values: success, failure.
    • messageString
      Message to show the merchant.

Example:

// to void a bar tab with completion reference 543123
iclient.voidTab("543123", yourPosCode.handleResponse);